# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=imagejs
pkgver=56.a442f94
pkgrel=3
groups=('blackarch' 'blackarch-binary' 'blackarch-webapp')
pkgdesc='Small tool to package javascript into a valid image file.'
arch=('x86_64' 'aarch64')
url='https://github.com/jklmnn/imagejs'
license=('GPL3')
depends=('python2')
makedepends=('git' 'cmake')
source=("git+https://github.com/jklmnn/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  cmake .
  make
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

